#ifndef GAME_STATEHANDLER_H
#define GAME_STATEHANDLER_H

class B_GameState;

// BASE CLASS
//  a game state handler owns a game state and is in
//  charge of passing events, updates, and assets to it
class B_GameStateHandler
{
public:
	// class constructor
	B_GameStateHandler();
	// class destructor
	virtual ~B_GameStateHandler();

protected:
	char m_LastStateName[256];  //enum of the current state
    char m_CurrStateName[256];  //enum of the current state
    B_GameState *m_CurrState; //pointer to the current state
    bool destroyMe;           //set by requestDestroy, will call Destroy() if true

public:

    //passively tell game to quit (will be handled next loop)
    void RequestDestroy() { destroyMe = true; }

    //ask the handler to transition to a different state
	virtual bool RequestStateChange(char* newState) { return false; }

	char* getCurrStateName() { return m_CurrStateName; }

	//sub-states can use this to request handler-specific data safely
	// returns NULL if requested asset does not belong to specific handler
	virtual void* getAsset(char* assetName) { return 0; }
};

#endif
